package cn.gok.springsecuritydemo05.service;

import cn.gok.springsecuritydemo05.dao.RoleDAO;
import cn.gok.springsecuritydemo05.entity.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: chen fan
 * @since: 2022/11/22 16:30
 * @description:
 */
@Service
public class RoleService {

    @Autowired
    RoleDAO roleDAO;

    public List<Role> findRolesByUserName(String userName){
        return roleDAO.findRolesByUserName(userName);
    }

    public List<Role> findRolesByPermissionId(Integer permissionId){
        return roleDAO.findRolesByPermissionId(permissionId);
    }
}
